package com.csdj.t309springboot.controller;


import com.csdj.t309springboot.common.WebResult;
import com.csdj.t309springboot.common.WebResultMsgCode;
import com.csdj.t309springboot.entity.PrizeRecord;
import com.csdj.t309springboot.service.PrizeRecordService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 获奖信息表 前端控制器
 * </p>
 *
 * @author 谭湛宇
 * @since 2022-01-14
 */
@RestController
@RequestMapping("/prize-record")
public class PrizeRecordController {
    @Resource
    private PrizeRecordService prizeRecordService;
    @PostMapping("/getTheLatestAward")
    public WebResult getTheLatestAward(){
        List<PrizeRecord> list = prizeRecordService.getTheLatestAward();
        if(null!=list){
            return new WebResult(WebResultMsgCode.SUCCESS).putData("list",list);
        }
        return new WebResult(WebResultMsgCode.FAIL);
    }
}
